/**
 * Matrix3.java
 * 
 * @date: 2012-02-28
 * @author: Xiaoyu Guo (MUN# 200982155)
 * This file is part of the course project for COMP 6752, 
 * Application of Computer Graphics. All the file is written
 * by myself.
 */
package mun.cs6752.project.model;

/** Defines a 3x3 matrix.
 * 3x3 matrices are commonly used in 2D (homogeneous coordinate) and 
 * 3D(Cartesian coordinate) transformations.
 * @author Xiaoyu Guo
 */
public class Matrix3 extends Matrix {

    /**
     * @param source
     */
    public Matrix3(double[][] source) {
        super(source);
        
        if(this.width != 3 || this.height != 3){
            throw new IllegalArgumentException("Illegal construction data for 3x3 matrix");
        }
    }

    public double getA11(){
        return data[0][0];
    }
    
    public double getA12(){
        return data[0][1];
    }
    
    public double getA13(){
        return data[0][2];
    }
    
    public double getA21(){
        return data[1][0];
    }
    
    public double getA22(){
        return data[1][1];
    }
    
    public double getA23(){
        return data[1][2];
    }
    
    public double getA31(){
        return data[2][0];
    }
    
    public double getA32(){
        return data[2][1];
    }
    
    public double getA33(){
        return data[2][2];
    }
    
    public Vector3 multiply(Vector3 value){
        Vector result = super.multiply(value);
        return new Vector3(result);
    }
}
